<!--客户来访模块-->
<template>
  <div  style="position: relative;">
    <mmTable ref="mmTable" :mmColumns="columns" :getUrl="url" :updateUrl="updateUrl" :delUrl="delUrl"
             :form="form" :formData="formData" v-on:formDataChange="formDataChange"
             :searchFormData="searchFormData" :searchForm="searchForm"
             :modalWidth="800">
      <Form slot="searchForm" ref="searchForm" :model="searchFormData" inline :label-width="70"  style="float: left">
        <FormItem label="用户名" prop="">
          <Input v-model="searchFormData.name" type="text" placeholder="" />
        </FormItem>
      </Form>
      <!--编辑添加模态框-->
      <Form  slot="editForm" :label-width="100" :model="formData" inline ref="editForm" :rules="formValidate">

        <Row>
          <Col :span="12">
          <FormItem label="来访编号" prop="billcode" style="width:300px">
            <Input v-model="formData.billcode" readonly/>
          </FormItem>
          </Col>
          <Col :span="12">
          <FormItem label="姓名" prop="visitname" style="width:300px">
            <Input v-model="formData.visitname" type="text"/>
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="12">
          <FormItem label="电话" prop="visitphone" style="width:300px">
            <Input v-model="formData.visitphone" type="text"/>
          </FormItem>
          </Col>
          <Col :span="12  ">
          <FormItem label="车牌号" prop="car" style="width:300px">
            <Input v-model="formData.car" type="text"/>
          </FormItem>
          </Col>
        </Row>
        <Row>
          <Col :span="24">
          <FormItem label="备注" prop="memo" style="width:660px">
            <Input v-model="formData.memo" type="textarea" height="300"/>
          </FormItem>
          </Col>
        </Row>
      </Form>
    </mmTable>
  </div>
</template>

<script>
import mmTable from '../components/mmtable/mmtable.vue'
import { getInPlanByCar } from '@/api/busi'
export default {
  components: {
    mmTable
  },
  data () {
    /*显示列表*/
    return {
      columns: [
        { title: '编号', key: 'billcode', width: 200, align: 'center' },
        { title: '车牌', key: 'car', width: 200, align: 'center' },
        { title: '创建时间', key: 'createtime', width: 200, align: 'center' },
        { title: '姓名', key: 'visitname', width: 200, align: 'center' },
        { title: '创建人', key: 'creatorname', width: 200, align: 'center' },
        { title: '电话', key: 'visitphone', width: 200, align: 'center' },
        { title: '备注', key: 'memo', align: 'left', width: 320 }
      ],
      /*链接后台*/
      url: '/visit/getList',
      updateUrl: '/visit/Save',
      delUrl: '/visit/Delete',
      form: {},
      formValidate: {
      },
      searchForm: {},
      searchFormData: {
        code: '',
        name: ''
      },
      /*后台传的数据*/
      formData: {
        car: '',
        visitname: '',
        plancreatorname: '',
        visitphone: '',
        materialname: '',
        planbillcode: '',
        plangross: '',
        plantare: '',
        planreal: '',
        creatorname: '',
        memo: ''

      },
      searchFormData: {
        name: ''
      },
      searchForm: {}
    }
  },
  mounted () {
    this.form = this.$refs.editForm
    this.searchForm = this.$refs.searchForm
  },
  /*方法*/
  methods: {
    formDataChange (data) {
      this.formData = data
    }
  }
}
</script>

<style>

</style>
